package com.itheima.mall.controller;

import com.itheima.mall.pojo.Demo;
import com.itheima.mall.service.DemoService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class DemoController {

    @Resource
    private DemoService demoService;

    @GetMapping
    public ResponseEntity<Demo> getDemo(String name,Long age){
        Demo demo = demoService.getDemo(name,age);
        return ResponseEntity.ok(demo);
    }



}
